#pragma once
#include "Entity.h"

class Projectile : public Entity
{
private:
	/// Amount of damage inflicted on impact
	byte damage;

	/// The entity that created the projectile
	Entity* owner;

	/// Image displayed for the projectile
	Image* image;

	/// Can this projectile only hit the player (so enemies don't kill each other)
	bool hitPlayerOnly;

	inline bool checkEntity(Entity* e);
public:
	/**
	 * \param owner The entity that created the projectile
	 * \param image The image (or animation) used to represent the projectile
	 * \param x The starting x-position
	 * \param y The starting y-position
	 * \param u The horizontal velocity
	 * \param u The vertical velocity
	 * \param v The amount of damage inflicted on hit
	 * \param hitPlayerOnly Can the projectile hit the player only (as opposed to all entities)
	 * \param applyGravity Is the projectile affected by gravity
	 */
	Projectile(Entity* owner, Image* image, int x, int y, float u, float v, byte damage, bool hitPlayerOnly, bool applyGravity = false);

	virtual ~Projectile();

	virtual void tick();

	virtual Image* getCurrentImage(){ return image; }
};
